--This trigger will update the amount of the buyers purchases year-to-date whenever a sale is completed.

create or replace trigger UPDATEBUYERYTD
after insert on Sale
for each row
begin
		update Buyer
		set purchasesYearToDate = purchasesYearToDate + :NEW.salePrice
		where Buyer.buyerID = :NEW.buyerID;
end;
/
